Vcpus are passed to device model and vmx domain builder.
Signed-off-by: Yan Li <yanx.li@intel.com>
Signed-off-by: Xin Li <xin.b.li@intel.com>
# A name for your domain. All domains must have different names.
name = "ExampleVMXDomain"
+#-----------------------------------------------------------------------------
+# the number of cpus guest platform has, default=1
+vcpus=1
+
# Which CPU to start domain on?
#cpu = -1 # leave to Xen to pick
int vm_running;
int audio_enabled = 0;
int nic_pcnet = 1;
+int vcpus = 1;
int sb16_enabled = 1;
int adlib_enabled = 1;
int gus_enabled = 1;
"-snapshot write to temporary files instead of disk image files\n"
"-m megs set virtual RAM size to megs MB [default=%d]\n"
"-nographic disable graphical output and redirect serial I/Os to console\n"
+ "-vcpus set CPU number of guest platform\n"
#ifdef CONFIG_VNC
"-vnc port use vnc instead of sdl\n"
"-vncport port use a different port\n"
QEMU_OPTION_hdachs,
QEMU_OPTION_L,
QEMU_OPTION_no_code_copy,
+ QEMU_OPTION_vcpus,
QEMU_OPTION_pci,
QEMU_OPTION_nic_pcnet,
QEMU_OPTION_isa,
{ "hdachs", HAS_ARG, QEMU_OPTION_hdachs },
{ "L", HAS_ARG, QEMU_OPTION_L },
{ "no-code-copy", 0, QEMU_OPTION_no_code_copy },
+ { "vcpus", 1, QEMU_OPTION_vcpus },
#ifdef TARGET_PPC
{ "prep", 0, QEMU_OPTION_prep },
{ "g", 1, QEMU_OPTION_g },
case QEMU_OPTION_S:
start_emulation = 0;
break;
+ case QEMU_OPTION_vcpus:
+ vcpus = atoi(optarg);
+ fprintf(logfile, "qemu: the number of cpus is %d\n", vcpus);
case QEMU_OPTION_pci:
pci_enabled = 1;
break;
/* Mask all upcalls... */
for ( i = 0; i < MAX_VIRT_CPUS; i++ )
shared_info->vcpu_data[i].evtchn_upcall_mask = 1;
+
+ shared_info->n_vcpu = vcpus;
+ printf(" VCPUS: %d\n", shared_info->n_vcpu);
+
munmap(shared_info, PAGE_SIZE);
/* Populate the event channel port in the shared page */
# xm config file
def parseDeviceModelArgs(self, config):
dmargs = [ 'cdrom', 'boot', 'fda', 'fdb',
- 'localtime', 'serial', 'stdvga', 'isa' ]
+ 'localtime', 'serial', 'stdvga', 'isa', 'vcpus' ]
ret = []
for a in dmargs:
v = sxp.child_value(config, a)
def configure_vmx(opts, config_image, vals):
"""Create the config for VMX devices.
"""
- args = [ 'memmap', 'device_model', 'cdrom',
+ args = [ 'memmap', 'device_model', 'vcpus', 'cdrom',
'boot', 'fda', 'fdb', 'localtime', 'serial', 'macaddr', 'stdvga',
'isa', 'nographic', 'vnc', 'vncviewer', 'sdl', 'display']
for a in args: